package nullby.common.utils;

import android.util.Log;

/**
 * Provides application storage paths
 * 
 * @author Sergey Bandysik (bandysik[at]gmail[dot]com)
 */
public final class CustomLog {

	public static final String TAG = CustomLog.class.getSimpleName();

	/**
	 * Set this to true to enable log output. Remember to turn this back off
	 * before releasing. Sending sensitive data to log is a security risk.
	 */
	private static final boolean ENABLE_LOG = true;

	/**
	 * A proxy for Log.d api that kills log messages in release build. It not
	 * recommended to send sensitive information to log output in shipping apps.
	 * 
	 * @param tag
	 * @param msg
	 */
	public final static void logD(final String tag, final String msg,
			final Exception e) {
		if (ENABLE_LOG) {
			Log.d(tag, msg, e);
		}
	}

	public final static void logD(final String tag, final String msg) {
		logD(tag, msg, null);
	}

	public final static void logE(final String tag, final String msg,
			final Exception e) {
		if (ENABLE_LOG) {
			Log.e(tag, msg, e);
		}
	}

	public final static void logE(final String tag, final String msg) {
		logE(tag, msg, null);
	}

	public final static void logI(final String tag, final String msg,
			final Exception e) {
		if (ENABLE_LOG) {
			Log.i(tag, msg, e);
		}
	}

	public final static void logI(final String tag, final String msg) {
		logI(tag, msg, null);
	}

	public final static void logV(final String tag, final String msg,
			final Exception e) {
		if (ENABLE_LOG) {
			Log.v(tag, msg, e);
		}
	}

	public final static void logV(final String tag, final String msg) {
		logV(tag, msg, null);
	}

	public final static void logW(final String tag, final String msg,
			final Exception e) {
		if (ENABLE_LOG) {
			Log.w(tag, msg, e);
		}
	}

	public final static void logW(final String tag, final String msg) {
		logW(tag, msg, null);
	}
}
